package cn.itsy.service.duct;

import cn.itsy.dao.duct.DuctDao;
import cn.itsy.pojo.Duct;
import cn.itsy.pojo.Emp;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description:
 * @author: MisterGay
 * @date: 2019-05-30 8:28
 */
@Service(value = "ductServiceimpl")
public class DuctServiceimpl implements DuctService {
    @Resource(name = "ductDaoimpl")
    private DuctDao ducTypeDao;

    @Override
    public List<Duct> queryAllDucType(String sql) {
        List<Duct> ductypes = this.ducTypeDao.queryAllDucType(sql);
        return ductypes;
    }

    @Override
    public boolean updateDuctNameById(String sql, Duct duct) {
        Integer integer = this.ducTypeDao.updateDuctNameById(sql, duct);
        if (integer != 0) {
            return true;
        }
        return false;
    }

    @Override
    public boolean updateDuctNameById(String sql, Duct duct, Integer oldId) {
        Integer integer = this.ducTypeDao.updateDuctNameById(sql, duct, oldId);
        if (integer != 0) {
            return true;
        }
        return false;
    }

    @Override
    public boolean deleteDuctById(String sql, Duct duct) {
        Integer integer = this.ducTypeDao.deleteDuctById(sql, duct);
        if (integer != 0) {
            return true;
        }
        return false;
    }

    @Override
    public List<Emp> queryEmpById(String sql, Duct duct) {
        List<Emp> emps = this.ducTypeDao.queryEmpById(sql, duct);
        return emps;
    }
}
